<?php

namespace app\api\model;

use think\Model;

class BlackList extends Model
{
    // 自动写入时间戳字段
    protected $autoWriteTimestamp = 'int';

    // 定义时间戳字段名
    protected $createTime = 'createtime';
    protected $updateTime = 'updatetime';

    public function blackList($user_id)
    {
        return $this
            ->alias('a')
            ->where('a.user_id', $user_id)
            ->join('user_info b', 'a.black_id = b.user_id')
            ->field('b.avatar,b.username,a.black_id')
            ->order('a.id desc')
            ->select();
    }
}